<template>
  <router-view v-slot="{ Component }">
    <component :is="Component" v-if="Component"/>
    <div v-else>加载中...</div>
  </router-view>
</template>

<script setup>
import {onMounted, onUnmounted} from 'vue'
import {useRouter} from 'vue-router'


const router = useRouter()

onMounted(() => {
  console.log('App mounted, current route:', router.currentRoute.value)
  //启动plc服务
})

onUnmounted(() => {
  console.log('App unmounted')
})
</script>

<style>
/* 全局样式 */
body {
  font-family: '微软雅黑';
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
</style>
